package restaurant;

/**
 * The Command object to delete an offer.
 * 
 * @author Odessa
 */

public class cmdDeleteOffer implements Command
{

	/** The information aggregator. */
	private InformationAggregator info;

	/** The offer number of the offer to delete. */
	private int offerNo;



	/**
	 * Instantiates a new delete offer command.
	 * 
	 * @param info the information aggregator.
	 * @param offerNo the offer number to delete.
	 */
	public cmdDeleteOffer(InformationAggregator info, int offerNo) {
		this.info = info;
		this.offerNo = offerNo;
	}



	/**
	 * Deletes a new offer.
	 * 
	 * @return a String stating offer deleted successfully.
	 * @see restaurant.Command#execute()
	 */
	@Override
	public Object execute()
	{
		SpecialOffers offers = info.getOffers();
		offers.delete(offerNo);

		return "Successfully deleted offer number " + offerNo;
	}

}
